package apps.sim.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class Configuration {
	private final Properties properties;
	public static final Configuration CONFIGURATION = new Configuration();

	private Configuration() {
		properties = new Properties();
		try {

			final File file = new File("shycop.properties");
			final InputStream inStream = new FileInputStream(file);
			properties.load(inStream);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public String get(String key) {
		return (String) properties.get(key);
	}

	public String get(String key, String defaultValue) {
		final String object = (String) properties.get(key);
		return object != null ? object : defaultValue;
	}
}
